<script lang="ts">
	import ViewResourceExamModal from '../modals/resource/ViewResourceExamModal.svelte';
	import { roadmapStore } from '../store.svelte';

	let showExamModal = $state(false);
</script>

<div class="bg-base-200 w-[200px] h-[150px] rounded-box p-2">
	<h2 class="font-bold text-2xl">学习状态</h2>
	<div class="flex justify-center mt-[30px]">
		<button type="button" class="btn btn-accent" onclick={() => (showExamModal = true)}
			>查看试题</button
		>
	</div>
</div>

<div class="absolute -left-[10000px]">
	{#if showExamModal && roadmapStore.selectNodeIdList.length > 0}
		<ViewResourceExamModal onClose={() => (showExamModal = false)} />
	{/if}
</div>
